<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>3dchess: GameLogic Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3dchess
   </div>
   <div id="projectbrief">Basic chess application with OpenGL graphics and AI</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="class_game_logic-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">GameLogic Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> implementation for a game of chess with observers.  
 <a href="class_game_logic.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_game_logic_8h_source.html">GameLogic.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for GameLogic:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_game_logic.png" usemap="#GameLogic_map" alt=""/>
  <map id="GameLogic_map" name="GameLogic_map">
<area href="class_abstract_game_logic.html" title="Interface for chess game logic implementations. " alt="AbstractGameLogic" shape="rect" coords="0,0,122,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac4aa2c551f2bfa79a7a2e90217261018"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#ac4aa2c551f2bfa79a7a2e90217261018">GameLogic</a> (AbstractPlayerPtr white, AbstractPlayerPtr black, GameConfigurationPtr config, <a class="el" href="class_game_state.html">GameState</a> initialGameState=<a class="el" href="class_game_state.html">GameState</a>())</td></tr>
<tr class="memdesc:ac4aa2c551f2bfa79a7a2e90217261018"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up a <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> object for one chess game.  <a href="#ac4aa2c551f2bfa79a7a2e90217261018">More...</a><br/></td></tr>
<tr class="separator:ac4aa2c551f2bfa79a7a2e90217261018"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae844f6285e60069594377c6140faf5ef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae844f6285e60069594377c6140faf5ef"></a>
virtual AbstractPlayerPtr&#160;</td><td class="memItemRight" valign="bottom"><b>getWhitePlayer</b> () const override</td></tr>
<tr class="separator:ae844f6285e60069594377c6140faf5ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01783ccc5652e672936685db8ce59696"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01783ccc5652e672936685db8ce59696"></a>
virtual AbstractPlayerPtr&#160;</td><td class="memItemRight" valign="bottom"><b>getBlackPlayer</b> () const override</td></tr>
<tr class="separator:a01783ccc5652e672936685db8ce59696"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb1079537a901e860b11398d66c50286"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#adb1079537a901e860b11398d66c50286">addObserver</a> (AbstractGameObserverPtr observer) override</td></tr>
<tr class="memdesc:adb1079537a901e860b11398d66c50286"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers an observer for game events.  <a href="#adb1079537a901e860b11398d66c50286">More...</a><br/></td></tr>
<tr class="separator:adb1079537a901e860b11398d66c50286"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c26b311430837d51cc7696c8094abbc"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a6c26b311430837d51cc7696c8094abbc">isGameOver</a> () const override</td></tr>
<tr class="separator:a6c26b311430837d51cc7696c8094abbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca3264bf6955426c20712a8216365b57"><td class="memItemLeft" align="right" valign="top">virtual PlayerColor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#aca3264bf6955426c20712a8216365b57">getWinner</a> () const override</td></tr>
<tr class="separator:aca3264bf6955426c20712a8216365b57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6397a2b36a7aa7d60d7ae49da00a9263"><td class="memItemLeft" align="right" valign="top">virtual GameConfigurationPtr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a6397a2b36a7aa7d60d7ae49da00a9263">getConfiguration</a> () const override</td></tr>
<tr class="separator:a6397a2b36a7aa7d60d7ae49da00a9263"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bd1137d1dd4ac474330b0e0c6f38fbe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9bd1137d1dd4ac474330b0e0c6f38fbe"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a9bd1137d1dd4ac474330b0e0c6f38fbe">stop</a> () override</td></tr>
<tr class="memdesc:a9bd1137d1dd4ac474330b0e0c6f38fbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiates a shutdown of the game logic. <br/></td></tr>
<tr class="separator:a9bd1137d1dd4ac474330b0e0c6f38fbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_abstract_game_logic"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_abstract_game_logic')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_abstract_game_logic.html">AbstractGameLogic</a></td></tr>
<tr class="memitem:a8dd1e091416320558bca6e04b49f88fb inherit pub_methods_class_abstract_game_logic"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_game_logic.html#a8dd1e091416320558bca6e04b49f88fb">start</a> ()</td></tr>
<tr class="memdesc:a8dd1e091416320558bca6e04b49f88fb inherit pub_methods_class_abstract_game_logic"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts the game logic thread.  <a href="#a8dd1e091416320558bca6e04b49f88fb">More...</a><br/></td></tr>
<tr class="separator:a8dd1e091416320558bca6e04b49f88fb inherit pub_methods_class_abstract_game_logic"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f87090c8542b9f15d3271ddc8b428f3 inherit pub_methods_class_abstract_game_logic"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_game_logic.html#a2f87090c8542b9f15d3271ddc8b428f3">join</a> ()</td></tr>
<tr class="memdesc:a2f87090c8542b9f15d3271ddc8b428f3 inherit pub_methods_class_abstract_game_logic"><td class="mdescLeft">&#160;</td><td class="mdescRight">Will block until the logic thread terminated.  <a href="#a2f87090c8542b9f15d3271ddc8b428f3">More...</a><br/></td></tr>
<tr class="separator:a2f87090c8542b9f15d3271ddc8b428f3 inherit pub_methods_class_abstract_game_logic"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a29927895ae4be5d9d868d362f990274c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a29927895ae4be5d9d868d362f990274c">run</a> () override</td></tr>
<tr class="memdesc:a29927895ae4be5d9d868d362f990274c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes a blocking game loop implementation.  <a href="#a29927895ae4be5d9d868d362f990274c">More...</a><br/></td></tr>
<tr class="separator:a29927895ae4be5d9d868d362f990274c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38628386737b55ef8ef89aa5fa2f8d71"><td class="memTemplParams" colspan="2">template&lt;typename Future &gt; </td></tr>
<tr class="memitem:a38628386737b55ef8ef89aa5fa2f8d71"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a38628386737b55ef8ef89aa5fa2f8d71">wait_for</a> (Future &amp;&amp;fut, std::chrono::milliseconds waitInMs)</td></tr>
<tr class="memdesc:a38628386737b55ef8ef89aa5fa2f8d71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function for performing an interruptable wait on a future.  <a href="#a38628386737b55ef8ef89aa5fa2f8d71">More...</a><br/></td></tr>
<tr class="separator:a38628386737b55ef8ef89aa5fa2f8d71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3afc88f5016906fe31c2b1d3629bb171"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a3afc88f5016906fe31c2b1d3629bb171">wait</a> (std::chrono::milliseconds waitInMs) const </td></tr>
<tr class="memdesc:a3afc88f5016906fe31c2b1d3629bb171"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function for performing an interruptable wait.  <a href="#a3afc88f5016906fe31c2b1d3629bb171">More...</a><br/></td></tr>
<tr class="separator:a3afc88f5016906fe31c2b1d3629bb171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae780b5568107a0b6a16aab34d53a3ec4"><td class="memTemplParams" colspan="2">template&lt;typename Function &gt; </td></tr>
<tr class="memitem:ae780b5568107a0b6a16aab34d53a3ec4"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_game_logic.html#ae780b5568107a0b6a16aab34d53a3ec4">notify</a> (Function &amp;&amp;f)</td></tr>
<tr class="memdesc:ae780b5568107a0b6a16aab34d53a3ec4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to call a given function on all attached observers.  <a href="#ae780b5568107a0b6a16aab34d53a3ec4">More...</a><br/></td></tr>
<tr class="separator:ae780b5568107a0b6a16aab34d53a3ec4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0bc9ab9793c940f0466145e8559e9348"><td class="memItemLeft" align="right" valign="top">AbstractPlayerPtr &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a0bc9ab9793c940f0466145e8559e9348">getCurrentPlayer</a> ()</td></tr>
<tr class="separator:a0bc9ab9793c940f0466145e8559e9348"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a21a741a5f051f4d1a519485188e13735"><td class="memItemLeft" align="right" valign="top">std::chrono::milliseconds&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a21a741a5f051f4d1a519485188e13735">m_tickLength</a></td></tr>
<tr class="memdesc:a21a741a5f051f4d1a519485188e13735"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interval in which the <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> should check for aborts (.  <a href="#a21a741a5f051f4d1a519485188e13735">More...</a><br/></td></tr>
<tr class="separator:a21a741a5f051f4d1a519485188e13735"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6999355d95c1f0def70b1731fbaff542"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6999355d95c1f0def70b1731fbaff542"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#a6999355d95c1f0def70b1731fbaff542">m_abort</a></td></tr>
<tr class="memdesc:a6999355d95c1f0def70b1731fbaff542"><td class="mdescLeft">&#160;</td><td class="mdescRight">If true the running game is aborted. <br/></td></tr>
<tr class="separator:a6999355d95c1f0def70b1731fbaff542"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5653b77b000ccc25ba2043aba3edda0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa5653b77b000ccc25ba2043aba3edda0"></a>
std::vector<br class="typebreak"/>
&lt; AbstractGameObserverPtr &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game_logic.html#aa5653b77b000ccc25ba2043aba3edda0">m_observers</a></td></tr>
<tr class="memdesc:aa5653b77b000ccc25ba2043aba3edda0"><td class="mdescLeft">&#160;</td><td class="mdescRight">List of observers for the game to be notified of game events (contains players) <br/></td></tr>
<tr class="separator:aa5653b77b000ccc25ba2043aba3edda0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3726e25edd2c9d353ac474dd92e6aa8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3726e25edd2c9d353ac474dd92e6aa8"></a>
AbstractPlayerPtr&#160;</td><td class="memItemRight" valign="bottom"><b>m_white</b></td></tr>
<tr class="separator:ab3726e25edd2c9d353ac474dd92e6aa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa2135f44858c0ce83c7477420bb00f1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa2135f44858c0ce83c7477420bb00f1"></a>
AbstractPlayerPtr&#160;</td><td class="memItemRight" valign="bottom"><b>m_black</b></td></tr>
<tr class="separator:afa2135f44858c0ce83c7477420bb00f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1a59dd4f2a831815b30762d73868337"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac1a59dd4f2a831815b30762d73868337"></a>
<a class="el" href="class_game_state.html">GameState</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_gameState</b></td></tr>
<tr class="separator:ac1a59dd4f2a831815b30762d73868337"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae208a90d3861f73db9a27caff6142600"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae208a90d3861f73db9a27caff6142600"></a>
GameConfigurationPtr&#160;</td><td class="memItemRight" valign="bottom"><b>m_config</b></td></tr>
<tr class="separator:ae208a90d3861f73db9a27caff6142600"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5148ff4cdde3651edb1c62c468740172"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5148ff4cdde3651edb1c62c468740172"></a>
Logging::Logger&#160;</td><td class="memItemRight" valign="bottom"><b>m_log</b></td></tr>
<tr class="separator:a5148ff4cdde3651edb1c62c468740172"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_class_abstract_game_logic"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_abstract_game_logic')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="class_abstract_game_logic.html">AbstractGameLogic</a></td></tr>
<tr class="memitem:a06cdc7309d6103d73d1ba8ed93f8729e inherit pro_attribs_class_abstract_game_logic"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06cdc7309d6103d73d1ba8ed93f8729e"></a>
std::thread&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_game_logic.html#a06cdc7309d6103d73d1ba8ed93f8729e">m_thread</a></td></tr>
<tr class="memdesc:a06cdc7309d6103d73d1ba8ed93f8729e inherit pro_attribs_class_abstract_game_logic"><td class="mdescLeft">&#160;</td><td class="mdescRight">Game logic thread. <br/></td></tr>
<tr class="separator:a06cdc7309d6103d73d1ba8ed93f8729e inherit pro_attribs_class_abstract_game_logic"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> implementation for a game of chess with observers. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac4aa2c551f2bfa79a7a2e90217261018"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GameLogic::GameLogic </td>
          <td>(</td>
          <td class="paramtype">AbstractPlayerPtr&#160;</td>
          <td class="paramname"><em>white</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">AbstractPlayerPtr&#160;</td>
          <td class="paramname"><em>black</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">GameConfigurationPtr&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_game_state.html">GameState</a>&#160;</td>
          <td class="paramname"><em>initialGameState</em> = <code><a class="el" href="class_game_state.html">GameState</a>()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets up a <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> object for one chess game. </p>
<dl class="section note"><dt>Note</dt><dd>Don't forget to start operation by calling start. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">white</td><td>White player reference </td></tr>
    <tr><td class="paramname">black</td><td>Black player reference </td></tr>
    <tr><td class="paramname">config</td><td>Configuration for this game </td></tr>
    <tr><td class="paramname">initialGameState</td><td>Initial state when starting the game </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="adb1079537a901e860b11398d66c50286"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GameLogic::addObserver </td>
          <td>(</td>
          <td class="paramtype">AbstractGameObserverPtr&#160;</td>
          <td class="paramname"><em>observer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Registers an observer for game events. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="class_abstract_game_observer.html" title="Allows to observe relevant GameEvents inside the GameLogic. ">AbstractGameObserver</a> for the available events. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">observer</td><td>Observer to register. </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="class_abstract_game_logic.html#a523af5dd0224a3b368dced118c1d6625">AbstractGameLogic</a>.</p>

</div>
</div>
<a class="anchor" id="a6397a2b36a7aa7d60d7ae49da00a9263"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">GameConfigurationPtr GameLogic::getConfiguration </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_game_configuration.html" title="Class for holding game configuration parameters. ">GameConfiguration</a> currently used. </dd></dl>

<p>Implements <a class="el" href="class_abstract_game_logic.html#a7a3d2369e905cbc22cde69f3eb30e47b">AbstractGameLogic</a>.</p>

</div>
</div>
<a class="anchor" id="a0bc9ab9793c940f0466145e8559e9348"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">AbstractPlayerPtr &amp; GameLogic::getCurrentPlayer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Returns a reference to the next player to make his turn. </dd></dl>

</div>
</div>
<a class="anchor" id="aca3264bf6955426c20712a8216365b57"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">PlayerColor GameLogic::getWinner </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>If isGameOver returns the winner of the game. </dd></dl>

<p>Implements <a class="el" href="class_abstract_game_logic.html#a5b037507bbf853dc12ced1edb9c34e6b">AbstractGameLogic</a>.</p>

</div>
</div>
<a class="anchor" id="a6c26b311430837d51cc7696c8094abbc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool GameLogic::isGameOver </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>true if game has ended. </dd></dl>

<p>Implements <a class="el" href="class_abstract_game_logic.html#a1acbb3bc5df48339c44c57075d9eb680">AbstractGameLogic</a>.</p>

</div>
</div>
<a class="anchor" id="ae780b5568107a0b6a16aab34d53a3ec4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Function &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GameLogic::notify </td>
          <td>(</td>
          <td class="paramtype">Function &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Function to call a given function on all attached observers. </p>
<p>Basically a observers.map(function).</p>
<p>Usage: notify([&amp;](AbstractGameObserverPtr&amp; obs) { // This is your function which is handed obs obs-&gt;someObserverFunction(parameters); });</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>Function which takes an AbstractGameObserverPtr as an argument. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a29927895ae4be5d9d868d362f990274c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GameLogic::run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">private</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Executes a blocking game loop implementation. </p>
<p>Repeatedly asks the white and black player to take turns until one wins the game or another game terminating event occurs. Notifies registered observer of game state changes and handles timeout events. </p>

<p>Implements <a class="el" href="class_abstract_game_logic.html#a185f9cff8f72348f4805375ec88539b5">AbstractGameLogic</a>.</p>

</div>
</div>
<a class="anchor" id="a3afc88f5016906fe31c2b1d3629bb171"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void GameLogic::wait </td>
          <td>(</td>
          <td class="paramtype">std::chrono::milliseconds&#160;</td>
          <td class="paramname"><em>waitInMs</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function for performing an interruptable wait. </p>
<p>Splits up a blocking wait into m_tickLength long waits with checks for the m_abort condition. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">waitInMs</td><td>Time to wait. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a38628386737b55ef8ef89aa5fa2f8d71"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Future &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool GameLogic::wait_for </td>
          <td>(</td>
          <td class="paramtype">Future &amp;&amp;&#160;</td>
          <td class="paramname"><em>fut</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::chrono::milliseconds&#160;</td>
          <td class="paramname"><em>waitInMs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Helper function for performing an interruptable wait on a future. </p>
<p>Splits up a usually uninterruptable wait on a future into m_tickLength long waits with checks for the m_abort condition. </p>
<dl class="section see"><dt>See Also</dt><dd>std::future&lt;&gt;::wait_for </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fut</td><td>Future to wait on </td></tr>
    <tr><td class="paramname">waitInMs</td><td>Maximum waiting time </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a21a741a5f051f4d1a519485188e13735"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::chrono::milliseconds GameLogic::m_tickLength</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Interval in which the <a class="el" href="class_game_logic.html" title="GameLogic implementation for a game of chess with observers. ">GameLogic</a> should check for aborts (. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="class_game_logic.html#a6999355d95c1f0def70b1731fbaff542" title="If true the running game is aborted. ">m_abort</a>) </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>S:/dev/3dchess/src/logic/<a class="el" href="_game_logic_8h_source.html">GameLogic.h</a></li>
<li>S:/dev/3dchess/src/logic/GameLogic.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Mar 9 2014 23:12:57 for 3dchess by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
